#pragma once
#include <iostream>
using namespace  std;
namespace Factory{
	class AbstractPro
	{
	public:
		AbstractPro(){}
		~AbstractPro(){}
		virtual void printName(){}
	};
	class Basketball :public AbstractPro
	{
	public:
		Basketball(){ printName(); }
		~Basketball(){}
		void printName() {
			cout << "this is basketball" << endl;
		}
	};
	class Football :public AbstractPro
	{
	public:
		Football() { printName(); }
		~Football() {}
		void printName() {
			cout << "this is football" << endl;
		}
	};

	class AbstractFac
	{
	public:
		AbstractFac(){}
		~AbstractFac(){}
		virtual AbstractPro* getPro()=0;
	};
	class FootballFac :public AbstractFac
	{
	public:
		FootballFac() {};
		~FootballFac() {}
		AbstractPro* getPro() {
			return  new Football();
		}		
	};

	class BasketballlFac :public AbstractFac
	{
	public:
		BasketballlFac() {}
		~BasketballlFac() {}
		AbstractPro* getPro() {
			return  new Basketball();
		}
	};

}
